//
//  ZSMainVC.m
//  WeChat
//
//  Created by Vincent_Guo on 2017/4/14.
//  Copyright © 2017年 微信号: vg-ios. All rights reserved.
//

#import "ZSMainVC.h"

@interface ZSMainVC ()

@end

@implementation ZSMainVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    //添加3个子控制器
    UIViewController *vc1 = [[UIViewController alloc] init];
    [self addChildVcToTabBarController:vc1 title:@"WeChat" normalImg:nil selectedImg:nil];
    UIViewController *vc2 = [[UIViewController alloc] init];
    [self addChildVcToTabBarController:vc2 title:@"联系人" normalImg:nil selectedImg:nil];
    
    
    UIViewController *vc3 = [UIStoryboard storyboardWithName:@"MySetting" bundle:nil].instantiateInitialViewController;
    [self addChildVcToTabBarController:vc3 title:@"我的设置" normalImg:nil selectedImg:nil];
    
    
}

//添加tabar控制器的子控制器
-(void)addChildVcToTabBarController:(UIViewController *)vc title:(NSString *)title normalImg:(NSString *)nmlImg selectedImg:(NSString *)sltImg{
    
    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
    nav.tabBarItem.title = title;
    [self addChildViewController:nav];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
